﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using System.Data;

namespace ATM
{
  public  class adminLogic
    {

        adminDB aDB = new adminDB();

        public bool login(int p)
        {
            if (aDB.checkAdmin(p))
                return true;
            else
                return false;
        }

        public DataSet showAllTransactions()
        {
            return aDB.transactionsAll();
        }
        public DataSet showUserTransactions(int id)
        {
            return aDB.transactionsUser(id);
        }
        public bool addUser(string name, string email, int accountNumber, float balance)
        {
            if (aDB.addUser(name, email , accountNumber, balance))
            {
                return true;
            }
            else
                return false;
        }
        public bool userExist(int accountNumber) 
        {
            if (aDB.userExist(accountNumber))
                return true;
            else
                return false;
        }
        public bool emailExist(string email)
        {
            if (aDB.emailExist(email))
                return true;
            else
                return false;
        }
        public bool deleteUser(int id)
        {
            if (aDB.deleteUser(id))
                return true;
            else
                return false;
        }

    }
}
